package com.xkcoding.orm.jpa.controller;

import com.xkcoding.orm.jpa.entity.vo.UserVO;
import com.xkcoding.orm.jpa.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    private UserService userService;
    @GetMapping("/hello")
    public String hello() {
        return "Hello, Spring Boot!"+userService.getUserOne();
    }

    @GetMapping("/page")
    public Page<UserVO> page() {
        return userService.queryPage(null,1,10);
    }

    @GetMapping("/pageObj")
    public Page<UserVO> pageObj() {
        return userService.queryPageObject(null,1,10);
    }
}
